<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("添加电子锁")}</title>
<link href="/resources/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/resources/js/reference/jquery.js"></script>
<script type="text/javascript" src="/resources/js/reference/jquery.validate.js"></script>
<script type="text/javascript" src="/resources/js/base/dialog.js"></script>
<script type="text/javascript" src="/resources/js/base/request.js"></script>
<script type="text/javascript" src="/resources/js/base/global.js"></script>
<script type="text/javascript" src="/resources/plugin/datePicker/WdatePicker.js"></script>
<script src="/resources/js/base/file.js"></script>
<script type="text/javascript">
$().ready(function() {
	var $inputForm = $("#inputForm");

	//查询机构
	$("#selectSaleOrg").bindQueryBtn({
		type:'saleOrg',
		title:'${message("查询机构")}',
		url:'/saleOrg/select_saleOrg.jhtml'
	});
	
	// 表单验证
	$inputForm.validate({
		rules: {
			elockNum: {
				required: true,
				digits:true
			},
			elockName: {
				required:true
			},
			saleOrgId: {
				required:true
			},
		}
	});
	
	 $("form").bindAttribute({
	 	isConfirm:true,
	    callback: function(resultMsg){
	        $.message_timer(resultMsg.type,resultMsg.content,1000,function(){
				location.href= 'edit.jhtml?id='+resultMsg.objx;
			})
	    }
	 });
	
});	
</script>
</head>
<body>
	<div class="pathh">
		&nbsp;${message("新增锁")}
	</div>
	<form id="inputForm" action="save.jhtml" method="post" type="ajax" validate-type="validate">
		<input type="hidden" name="memberType" value="ordinary" />
		<div class="tabContent">
			<table class="input input-edit">
			<tr>
				<th>
					<span class="requiredField">*</span>${message("锁编号")}:
				</th>
				<td>
					<span class="error-msg"><input type="text" name="elockNum" class="text " minlength="8" maxlength="8"   btn-fun="clear"/></span>
				</td>
				<th>
					<span class="requiredField">*</span>${message("锁名称")}:
				</th>
				<td>
					<span class="error-msg"><input type="text" name="elockName" class="text " maxlength="20"   btn-fun="clear"/></span>
				</td>
				<th>
					${message("锁密钥")}:
				</th>
				<td>
					<span class="error-msg"><input type="text" name="secretKey" class="text " maxlength="20" readonly value="112233"  btn-fun="clear"/></span>
				</td>
				<th>
					${message("锁类型")}:
				</th>
				<td>
					<select id="typeId" name="typeId" class="text">
						[#list elockTypes as elockType]
						<option value="${elockType.id}">${elockType.value}</option>
						[/#list]
					</select>
				</td>
			</tr>
			<tr>
				<th>
					${message("锁型号")}:
				</th>
				<td>
					<select id="modelId" name="modelId" class="text">
						[#list elockModels as elockModel]
						<option value="${elockModel.id}">${elockModel.value}</option>
						[/#list]
					</select>
				</td>
				<!--  <th>
					<span class="requiredField">*</span>${message("机构")}:
				</th>
				<td>
					<span class="search" style="position:relative">
					<input type="hidden" name="saleOrgId" class="text saleOrgId" btn-fun="clear" value="${saleOrg.id }"/>
					<input type="text" name="saleOrgName" class="text saleOrgName" maxlength="200" onkeyup="clearSelect(this)" value="${saleOrg.name }" readOnly/>
					<input type="button" class="iconSearch" value="" id="selectSaleOrg">
					</span>
				</td> -->
				<th>
					${message("备注")}:
				</th>
				<td>
					<span class="error-msg"><input type="text" name="remark" class="text " maxlength="20"   btn-fun="clear"/></span>
				</td>
				<th></th><td></td>
				<th></th><td></td>
			</tr>
		</table>
		</div>
		<div class="fixed-top">
			<input type="submit" id="submit_button" class="button sureButton" value="${message("1013")}" />
			<input type="button" onclick="location.reload(true);" class="button resetButton ml15" value="${message("重置")}">
		</div>
	</form>
</body>
</html>